﻿Imports Microsoft.Xna.Framework.Graphics
Imports Runa.Resources.ResourceManager
Imports Microsoft.Xna.Framework
Imports Runa.UI.Effects
Imports Runa.UI.Metadata

Namespace Global.Runa.UI.Styles

    Public Class TextStyle
        Inherits Style
        Implements INotifyPropertyChanged

        Public Event PropertyChanged(sender As Object, e As PropertyChangedEventArgs) Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged

        Public Property Background As Texture2DObject
        Public Property TextEffect As WpfEffectBase

        <XamlAwareAttribute(IsPlainType:=False, Initializer:=GetType(SpriteFontConverter))>
        Public Property Font As SpriteFont
            Get
                Return Me.m_Font
            End Get
            Set(value As SpriteFont)
                Me.m_Font = value
                Me.OnPropertyChanged("Font")
            End Set
        End Property

        <XamlAwareAttribute(IsPlainType:=False, Initializer:=GetType(ColorConverter))>
        Public Property TextColor As Color
            Get
                Return Me.m_TextColor
            End Get
            Set(value As Color)
                Me.m_TextColor = value
                Me.OnPropertyChanged("TextColor")
            End Set
        End Property

        Private m_Font As SpriteFont
        Private m_TextColor As Color

        Public Sub New()
            Me.TextColor = Color.White
            Me.Font = Me._ResourceContentManager.Load(Of SpriteFont)("HudFont.xnb")
        End Sub

        Public Sub New(ByVal g As Game)
            MyBase.New(g)
            Me.TextColor = Color.White
            Me.Font = Me._ResourceContentManager.Load(Of SpriteFont)("HudFont.xnb")
        End Sub

        Protected Sub OnPropertyChanged(ByVal propertyName As String)
            RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propertyName))
        End Sub

    End Class

End Namespace